#include "RenderThread.hpp"
#include "EyerCore/EyerCore.hpp"

#include "EyerGLCustomComponent/EyerGLCustomComponent.hpp"

#include <emscripten.h>

namespace Eyer
{
    RenderThread::RenderThread(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE _context)
    {
        _context = context;
    }

    RenderThread::~RenderThread()
    {

    }

    void RenderThread::Run()
    {
        emscripten_webgl_make_context_current(context);
        EyerLog("RenderThread Start\n");\

        if(julia == nullptr){
            julia = new Eyer::EyerGLJulia();
            julia->SetWH(1000, 1000);
        }
        glClear(GL_COLOR_BUFFER_BIT);
        julia->Draw();

        EyerLog("RenderThread Stop\n");
    }
}